package com.googlecode.neoevents;
import java.util.Date;

import javax.swing.*;
import com.googlecode.neoevents.java.awt.event.ActionListener;

public class HelloWorld {

	JFrame frame;
	
	public HelloWorld() {
		initJFrame();
		initComponents() ;
	}

	@ActionListener.actionPerformed
	private void gogogo() {
		frame.setTitle("Hello World "+ new Date());
	}
	
	protected void initComponents() {
		JButton button = new JButton("go! go! go!");
		button.addActionListener(new ActionListener(this));
		frame.getContentPane().add(button);
		
	}

	/**
	 * @return
	 */
	private void initJFrame() {
		frame= new JFrame("Testing Generic events, press button to set the date");
		frame.setBounds(100,100, 800, 100);
		frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				new HelloWorld();
			}
		});
		
		
	}
	
}
